package com.atguigu.springboot.config;/*
代码的功能：
@author:
@return:
@throws:
@args:    
*/

import org.apache.ibatis.session.Configuration;
import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer;
import org.springframework.context.annotation.Bean;
@org.springframework.context.annotation.Configuration
public class MyBatisConfig {
    @Bean
    public ConfigurationCustomizer configurationCustomizer(){
        return new ConfigurationCustomizer(){
            /**
             * 当数据库的列名和idea的列名不一致的时候
             * 开启下面的函数映射 就可以解决
             * @param configuration
             */
            @Override
            public void customize(Configuration configuration) {
                configuration.setMapUnderscoreToCamelCase(true);
            }
        };
    }
}
